import { Menu } from 'src/modules/system/menu/entities/menu.entity';
import { User } from 'src/modules/system/user/entities/user.entity';
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, ManyToOne, OneToMany, ManyToMany, JoinTable } from 'typeorm';
@Entity('role')
export class Role {
    @PrimaryGeneratedColumn('uuid')
    Id: string;
    @Column()
    Name: string; // 角色名称
    @Column()
    Description: string; // 角色描述
    @Column({default: 0})
    Deleted: number; // 删除标志，1为未删除，0为已删除
    @OneToMany(() => User, (user) => user.Role)
    Users: User[]; // 关联用户实体
    @ManyToMany(() => Menu)
    @JoinTable()
    Menus: Menu[]; // 关联菜单实体
}
